package org.freedoit.server.util;

import org.freedoit.common.shared.SharedTask;
import org.freedoit.server.om.Task;

public class Utils
{
	public static Task fromSharedData(SharedTask sharedTask)
	{
		Task newTask = new Task(null, sharedTask.getTaskTypeId(), sharedTask.getProjectId(),
				sharedTask.getTaskName(), sharedTask.getDescription(), sharedTask.getStartDate(), sharedTask.getDueDate(),
				sharedTask.getStartTime(), sharedTask.getDueTime(), sharedTask.getFinished(), sharedTask.getTaskTag(),
				sharedTask.getStatus(), null, null);
		
		if (sharedTask.getTaskId() != null)
			newTask.setTaskId(sharedTask.getTaskId());
		
		return newTask;
	}
}
